package org.apache.commons.httpclient.params;

import java.util.ArrayList;
import java.util.Arrays;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.HttpVersion;

public class DefaultHttpParamsFactory
  implements HttpParamsFactory
{
  static Class class$org$apache$commons$httpclient$SimpleHttpConnectionManager;
  private HttpParams httpParams;

  static Class class$(String paramString)
  {
    try
    {
      Class localClass = Class.forName(paramString);
      return localClass;
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }

  protected HttpParams createParams()
  {
    HttpClientParams localHttpClientParams = new HttpClientParams(null);
    localHttpClientParams.setParameter("http.useragent", "Jakarta Commons-HttpClient/3.1");
    localHttpClientParams.setVersion(HttpVersion.HTTP_1_1);
    Class localClass;
    label40: Object localObject1;
    if (class$org$apache$commons$httpclient$SimpleHttpConnectionManager == null)
    {
      localClass = class$("org.apache.commons.httpclient.SimpleHttpConnectionManager");
      class$org$apache$commons$httpclient$SimpleHttpConnectionManager = localClass;
      localHttpClientParams.setConnectionManagerClass(localClass);
      localHttpClientParams.setCookiePolicy("default");
      localHttpClientParams.setHttpElementCharset("US-ASCII");
      localHttpClientParams.setContentCharset("ISO-8859-1");
      localHttpClientParams.setParameter("http.method.retry-handler", new DefaultHttpMethodRetryHandler());
      ArrayList localArrayList = new ArrayList();
      String[] arrayOfString = new String[14];
      arrayOfString[0] = "EEE, dd MMM yyyy HH:mm:ss zzz";
      arrayOfString[1] = "EEEE, dd-MMM-yy HH:mm:ss zzz";
      arrayOfString[2] = "EEE MMM d HH:mm:ss yyyy";
      arrayOfString[3] = "EEE, dd-MMM-yyyy HH:mm:ss z";
      arrayOfString[4] = "EEE, dd-MMM-yyyy HH-mm-ss z";
      arrayOfString[5] = "EEE, dd MMM yy HH:mm:ss z";
      arrayOfString[6] = "EEE dd-MMM-yyyy HH:mm:ss z";
      arrayOfString[7] = "EEE dd MMM yyyy HH:mm:ss z";
      arrayOfString[8] = "EEE dd-MMM-yyyy HH-mm-ss z";
      arrayOfString[9] = "EEE dd-MMM-yy HH:mm:ss z";
      arrayOfString[10] = "EEE dd MMM yy HH:mm:ss z";
      arrayOfString[11] = "EEE,dd-MMM-yy HH:mm:ss z";
      arrayOfString[12] = "EEE,dd-MMM-yyyy HH:mm:ss z";
      arrayOfString[13] = "EEE, dd-MM-yyyy HH:mm:ss z";
      localArrayList.addAll(Arrays.asList(arrayOfString));
      localHttpClientParams.setParameter("http.dateparser.patterns", localArrayList);
      localObject1 = null;
    }
    Object localObject2;
    try
    {
      String str4 = System.getProperty("httpclient.useragent");
      localObject1 = str4;
      if (localObject1 != null)
        localHttpClientParams.setParameter("http.useragent", localObject1);
      label275: label289: label319: label341: label241: localObject2 = null;
    }
    catch (SecurityException localSecurityException1)
    {
      String str2;
      Object localObject3;
      try
      {
        String str3 = System.getProperty("httpclient.authentication.preemptive");
        localObject2 = str3;
        if (localObject2 != null)
        {
          str2 = localObject2.trim().toLowerCase();
          if (!(str2.equals("true")))
            break label319;
          localHttpClientParams.setParameter("http.authentication.preemptive", Boolean.TRUE);
        }
        localObject3 = null;
      }
      catch (SecurityException localSecurityException2)
      {
        try
        {
          String str1 = System.getProperty("apache.commons.httpclient.cookiespec");
          localObject3 = str1;
          if (localObject3 != null)
          {
            if (!("COMPATIBILITY".equalsIgnoreCase(localObject3)))
              break label341;
            localHttpClientParams.setCookiePolicy("compatibility");
          }
          do
            while (true)
            {
              return localHttpClientParams;
              localClass = class$org$apache$commons$httpclient$SimpleHttpConnectionManager;
              break label40:
              if (str2.equals("false"));
              localHttpClientParams.setParameter("http.authentication.preemptive", Boolean.FALSE);
              break label275:
              if (!("NETSCAPE_DRAFT".equalsIgnoreCase(localObject3)))
                break;
              localHttpClientParams.setCookiePolicy("netscape");
            }
          while (!("RFC2109".equalsIgnoreCase(localObject3)));
          localHttpClientParams.setCookiePolicy("rfc2109");
        }
        catch (SecurityException localSecurityException3)
        {
          break label289:
          localSecurityException2 = localSecurityException2;
        }
        break label241:
        localSecurityException1 = localSecurityException1;
      }
    }
  }

  public HttpParams getDefaultParams()
  {
    monitorenter;
    try
    {
      if (this.httpParams == null)
        this.httpParams = createParams();
      HttpParams localHttpParams = this.httpParams;
      monitorexit;
      return localHttpParams;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     org.apache.commons.httpclient.params.DefaultHttpParamsFactory
 * JD-Core Version:    0.5.3
 */